<template>
  <div class="article-love">
    <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
      <van-list
        v-model="loading"
        :finished="finished"
        finished-text="没有更多了"
        @load="onLoad"
      >
        <van-cell v-for="item in list" :key="item" :title="item" />
      </van-list>
    </van-pull-refresh>
  </div>
</template>

<script>
import { Wylist } from '@/api/Mylike'
import { mapGetters } from 'vuex'
import { Toast } from 'vant'
export default {
  data () {
    return {
      list: [],
      uid: null,
      loading: false,
      finished: false,
      refreshing: false,
      container: null,
      showShare: false
    }
  },
  computed: {
    ...mapGetters(['userInfo', 'ids'])
  },
  created () {
    this.uid = this.userInfo.userId

    this.onLoad()
  },
  mounted () {
    this.container = this.$refs.container
  },
  methods: {
    onSelect (option) {
      Toast(option.name)
      this.showShare = false
    },
    async onLoad () {
      console.log(this.userInfo)
      const data = await Wylist({ uid: this.uid, cookie: this.cookie })
      console.log(data)
    }
  }
}
</script>

<style scoped lang="less"></style>
